package org.wlgzs.office_exam_student.util;

import java.util.Random;

/**
 * Copyright (C), 2016-2018, 孤城落寞的博客
 * FileName: RandUtils
 * Author:   gclm
 * Date:     2018/1/25 下午3:13
 * Description: RandUtils
 */
public class RandUtils {

    //len 生成随机数的位数
    public static String randomHexString(int len)  {
        try {
            StringBuffer result = new StringBuffer();
            for(int i=0;i<len;i++) {
                result.append(Integer.toHexString(new Random().nextInt(16)));
            }
            return result.toString().toUpperCase();

        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();

        }
        return null;

    }

}
